function theangle=rightquadrant(Xsmall,Ysmall,Xbig,Ybig)
theangle=atan(abs((Ybig-Ysmall))./abs((Xbig- Xsmall)));
        if Xbig(1)==Xsmall(1)||Ybig(1)==Ysmall(1)
            if Xbig== Xsmall&&Ybig<Ysmall
                theangle=-pi/2;
            end
            if Xbig> Xsmall&&Ybig==Ysmall
                theangle=0;
            end
            if Xbig< Xsmall&&Ybig==Ysmall
                theangle=pi;
            end
            %now for vertical lines
        else
            if Xbig> Xsmall %4the quadrand
                if Ybig<Ysmall
                    theangle=-theangle;
                end
            else  %second,or third quadrant
                if Ybig>Ysmall %second quadrant
                    theangle=pi-theangle;
                else
                    theangle=theangle-pi; %third quadrant
                end
            end
        end
end